﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using EntityInterfaces;


namespace shopNet
{
    public class Customer
    {
        public string f_name, s_name, email, country, zip, state, city, address, phone;
        public static Customer Parse(IOrder entity) {
            return new Customer() { f_name = entity.cust_fname, s_name = entity.cust_sname, email = entity.cust_email,
                                    country = entity.cust_country, zip = entity.cust_zip, state = entity.cust_state,
                                    city = entity.cust_city, address = entity.cust_address, phone = entity.cust_phone};
        }
        public IOrder Convert() {
            var ret = DataFactory.SimpleFactory.CreateOrder();
            ret.cust_address = address; ret.cust_city = city; ret.cust_country = country; ret.cust_email = email;
            ret.cust_fname = f_name; ret.cust_sname = s_name; ret.cust_phone = phone; ret.cust_state = state;
            ret.cust_zip = zip;
            return ret;
        }
    }
}
